20. CNNs in Keras: Practical Example
CNNs in Keras: Practical Example
If you have not yet launched a GPU-enabled server with AWS, you are strongly encouraged to do so before running the notebooks from this video. While it is possible to train the notebooks on your CPU, an AWS GPU instance will be much faster.
The Jupyter notebooks described in the video can be accessed from the aind2-cnn
GitHub repository. Navigate to the cifar10-classification/ folder and open cifar10_mlp.ipynb and cifar10_cnn.ipynb.
A Note on the Validation Set
Earlier in the lesson, we trained a neural network with validation by setting the validation_split
argument in model.fit
to 0.2. This removed the final 20% of the training data, which was instead used as validation data. In the notebook for this video, instead of having Keras split off the validation set for us, we hard-code the split ourselves.
Optional Resources
- Here's a cheat sheet for specifying neural networks (including CNNs!) in Keras.
- Check out the CIFAR-10 Competition's winning architecture!